package controller

import "github.com/gin-gonic/gin"

type J struct {
	Code    int         `json:"code"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
}

func Rsuccess(c *gin.Context, code int, data interface{}, msg string) {
	json := &J{
		Code:    code,
		Data:    data,
		Message: msg,
	}
	c.JSON(200, json)
}

func Rerror(c *gin.Context, code int) {
	json := &J{
		Code: code,
	}
	c.JSON(200, json)
}
